//
//  UserViewController.m
//  老司机发车了
//
//  Created by SuperNing on 16/8/8.
//  Copyright © 2016年 斌. All rights reserved.
//

#import "UserViewController.h"
#import "MySongTableViewController.h"


@interface UserViewController ()

@end

@implementation UserViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
    UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
    blurView.frame = self.view.bounds;
    
    self.tableView.backgroundView = blurView;
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    
    if (indexPath.row == 0) {
        cell.textLabel.text = @"最近播放";
    }else if(indexPath.row == 1){
        cell.textLabel.text = @"下载歌曲";
    }else{
        cell.textLabel.text = @"我喜欢";
    }
    
    
    UIView *baselineView = [[UIView alloc] initWithFrame:CGRectMake(10, 78, screenWidth - 20, 2)];
    baselineView.backgroundColor = [UIColor whiteColor];
    [cell addSubview:baselineView];
    
    cell.textLabel.textColor = [UIColor whiteColor];
    cell.backgroundColor = [UIColor clearColor];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 80;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    MySongTableViewController *mySongVC = [[MySongTableViewController alloc] init];
    if (indexPath.row == 0) {
        mySongVC.tableName = @"musicTable";
    } else if(indexPath.row == 2){
        mySongVC.tableName = @"loveTable";
    }
    
    [self.navigationController pushViewController:mySongVC animated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
